package algorithm.practice.Impl;

import algorithm.practice.Itf.SortingInterface;

public class SortingImpl implements SortingInterface {

	@Override
	public int[] insertionSort(int[] numberArray) {
		int i, j, key;
		for (i = 1; i < numberArray.length; i++) {
			key = numberArray[i];
			j = i;
			while ((j > 0) && (numberArray[j - 1] > key)) {
				numberArray[j] = numberArray[j - 1];
				j--;
			}
			numberArray[j] = key;
		}
		return numberArray;
	}

}
